from dataclasses import dataclass
from convert import *
from tx_hashes import compute_auth_hash, compute_sig_hash, compute_tx_hash

@dataclass
class Test:
    tx_payload_selector: uint8
    rlp_tx_bytes: bytes
    ssz_tx_bytes: bytes
    sig_hash: Hash32
    rlp_tx_hash: Hash32
    ssz_tx_root: Hash32
    from_: ExecutionAddress
    authorities: list[ExecutionAddress]

tests = [
    Test(
        tx_payload_selector=0x01,
        rlp_tx_bytes=bytes.fromhex('f86780862d79883d2000825208945df9b87991262f6ba471f09758cde1c0fc1de734827a69801ca088ff6cf0fefd94db46111149ae4bfc179e9b94721fffd821d38d16464b3f71d0a045e0aff800961cfce805daef7016b9b675c137a6a41a548f7b60a3484c06a33a'),
        ssz_tx_bytes=bytes.fromhex('08000000720000000100000000000000000000203d88792d000000000000000000000000000000000000000000000000000008520000000000005df9b87991262f6ba471f09758cde1c0fc1de734697a00000000000000000000000000000000000000000000000000000000000069000000ff88ff6cf0fefd94db46111149ae4bfc179e9b94721fffd821d38d16464b3f71d045e0aff800961cfce805daef7016b9b675c137a6a41a548f7b60a3484c06a33a01'),
        sig_hash=Hash32(bytes.fromhex('19b1e28c14f33e74b96b88eba97d4a4fc8a97638d72e972310025b7e1189b049')),
        rlp_tx_hash=Hash32(bytes.fromhex('5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060')),
        ssz_tx_root=Hash32(bytes.fromhex('c5e88950f1c9eb88961abd039be5870749b8cf9f77f1ec000a0f233dd76740c0')),
        from_=ExecutionAddress(bytes.fromhex('a1e4380a3b1f749673e270229993ee55f35663b4')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x01,
        rlp_tx_bytes=bytes.fromhex('f86e8243eb850df847580082c35094df190dc7190dfba737d7777a163445b7fff161338806113a84987be800801ca03b08715b4403c792b8c7567edea634088bedcd7f60d9352b1f16c69830f3afd5a010b9afb67d2ec8b956f0e1dbc07eb79152904f3a7bf789fc869db56320adfe09'),
        ssz_tx_bytes=bytes.fromhex('08000000720000000100eb43000000000000005847f80d00000000000000000000000000000000000000000000000000000050c3000000000000df190dc7190dfba737d7777a163445b7fff1613300e87b98843a110600000000000000000000000000000000000000000000000069000000ff3b08715b4403c792b8c7567edea634088bedcd7f60d9352b1f16c69830f3afd510b9afb67d2ec8b956f0e1dbc07eb79152904f3a7bf789fc869db56320adfe0901'),
        sig_hash=Hash32(bytes.fromhex('05887873a4fc88813466382673be81701adc8f564f7bcd17e2ce974a43100d04')),
        rlp_tx_hash=Hash32(bytes.fromhex('e9e91f1ee4b56c0df2e9f06c2b8c27c6076195a88a7b8537ba8313d80e6f124e')),
        ssz_tx_root=Hash32(bytes.fromhex('0d25530ce7a938cc0d0eb2197a0251b2b3369522c91ae85de312fe16381f6684')),
        from_=ExecutionAddress(bytes.fromhex('32be343b94f860124dc4fee278fdcbd38c102d88')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x03,
        rlp_tx_bytes=bytes.fromhex('f88b822ecd8509839089a083015f909484654be796dad370032391d5479f8f1fd9ddd14e80a4d508e62389272d541e4168e5303b5838dcef5f9ac769a057f8dc6aabce7ec1e69b7ce5e625a078e88f9c69d217c76d92d5472f5812501021342f0054178c0579ee532dc2a218a0484723f0933633a6c213fc201ee3aecbe919579377b11a79acd887950a068e33'),
        ssz_tx_bytes=bytes.fromhex('08000000b600000003000100000000000000000000000000000000000000000000000000000000000000cd2e000000000000a089908309000000000000000000000000000000000000000000000000000000905f01000000000084654be796dad370032391d5479f8f1fd9ddd14e000000000000000000000000000000000000000000000000000000000000000089000000d508e62389272d541e4168e5303b5838dcef5f9ac769a057f8dc6aabce7ec1e69b7ce5e6ff78e88f9c69d217c76d92d5472f5812501021342f0054178c0579ee532dc2a218484723f0933633a6c213fc201ee3aecbe919579377b11a79acd887950a068e3300'),
        sig_hash=Hash32(bytes.fromhex('3e4c94ee2d68abe91ab5c97ad1111f5367a8cbdc8e907850ff9a297a11755441')),
        rlp_tx_hash=Hash32(bytes.fromhex('dc81918bf78322ce017c592e81c855f40bb96bd82da9779167de1de109962be6')),
        ssz_tx_root=Hash32(bytes.fromhex('008fb9a7e07e996506359bab1a60373cdbbc464ba40152b41c6fc459b1e78c2c')),
        from_=ExecutionAddress(bytes.fromhex('be49bd130e126a917ddb5fabf7cdeb6dd9887f40')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x05,
        rlp_tx_bytes=bytes.fromhex('01f90cc30182153680830bb224943765521db364ee269e9540970fd21e5a3e82569980b905845f53273d00000000000000000000000000000000000000000000000000112cfa39a81d7c00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004e4128acb080000000000000000000000003765521db364ee269e9540970fd21e5a3e825699000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001dac7be33000000000000000000000000000000000000000000000000000000010005bd8200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006a9850e46518231b23e50467c975fa94026be5d5000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000324128acb0800000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000001ade409ce94c21807e0000000000000000000000000000000000000000000000000000000010005bd8200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f1f85b2c54a2bd284b1cf4141d64fd171bd855390000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000f1f85b2c54a2bd284b1cf4141d64fd171bd8553900000000000000000000000000000000000000000000000034a2e5498f6f66f80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4022c0d9f0000000000000000000000000000000000000000000001ade409ce94c21807e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a9850e46518231b23e50467c975fa94026be5d500000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f906d7f859941c86b3cdf2a60ae3a574f7f71d44e2c50bddb87ef842a00000000000000000000000000000000000000000000000000000000000000003a050f2c0a7453ed72f1987f5c26e34dd531d584edf35a9b2dd71d8cbd0b46cbec2f87a94c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f863a0c5192a5360898ecb25d40688e79d4568e38430536a3f38f85b3859328d3cedbca0cc805915145ea1d9dd6fe22fe624a946d6b02968a5cf3e32ab5376b3fcedd207a0390f6178407c9b8e95802b8659e6df8e34c1e3d4f8d6a49e6132bbcdd937b63af7943765521db364ee269e9540970fd21e5a3e825699e1a00000000000000000000000000000000000000000000000000000000000000000f8fe94a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48f8e7a010d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390ba07050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3a01f21a62c4538bacf2aabeca410f0fe63151869f172e03c0e00357ba26a341effa00000000000000000000000000000000000000000000000000000000000000001a0faa1053f6d4d1d5c438dc7bcb1d301a860f75f57f936878518deaed1f60940d0a0390f6178407c9b8e95802b8659e6df8e34c1e3d4f8d6a49e6132bbcdd937b63aa0441b08c38c1e5e3510dc0c6fdeb4e6a8d60744b906171767ae804339d85b866cf89b946a9850e46518231b23e50467c975fa94026be5d5f884a0918cfc45073e7a8befeda107cec8f3ce514f4a406e227c253b570e1d6485d524a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004a00000000000000000000000000000000000000000000000000000000000000001f79457ab1ec28d129707052df4df418d58a2d46d5f51e1a00000000000000000000000000000000000000000000000000000000000000002f87a9405a9cbe762b36632b3594da4f082340e0e5343e8f863a0faa1053f6d4d1d5c438dc7bcb1d301a860f75f57f936878518deaed1f60940d0a0c5192a5360898ecb25d40688e79d4568e38430536a3f38f85b3859328d3cedbca00000000000000000000000000000000000000000000000000000000000000002f85994613c773c7a1d85d2f1dcc051b0573d33470762ebf842a00563a8a19823933e751ef690567f0351d13ee18500841743a77290b3deeac37da041feecc8dc55520132a464384eb4cad04fca8408899b069cf80a59042ac84c7af85994c757acba3c0506218b3022266a9dc7f3612d85f5f842a0ad77bf801726b2c83e9e3fa10f319bf2df99397a561126e8c3df0f7596519f75a0f0afdce5671e49e66c5829c89ac80a06875a30b8a123df04dc6cc02b9c7c845cf8dd94f1f85b2c54a2bd284b1cf4141d64fd171bd85539f8c6a00000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000006a00000000000000000000000000000000000000000000000000000000000000007a00000000000000000000000000000000000000000000000000000000000000009a0000000000000000000000000000000000000000000000000000000000000000aa0000000000000000000000000000000000000000000000000000000000000000cd6940000000000000000000000000000000000000000c0f89b9488e6a0c2ddd26feeb64f039a2c41296fcb3f5640f884a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004a00000000000000000000000000000000000000000000000000000000000000001a0a6172f64e80168333d3bc97ef096a7cb251d24be47156dff7a40f6163a6ab42bd694a2327a938febf5fec13bacfb16ae10ecbc4cbdcfc0f8dd944d8dbd193d89b7b506be5dc9db75b91da00d6a1df8c6a00000000000000000000000000000000000000000000000000000000000000004a0b79e191a25a1c10448c48948add5400e67bdba9b68cb8e4ab5ccc4025afe7bf6a0000000000000000000000000000000000000000000000000000000000000000ba0d8f0dca3c14b74279ad90a75338db7cccdd5b2448369aeb32a94693a1c4cde0da00000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000000000000000000000000000000000000000002f794545973f28950f50fc6c7f52aab4ad214a27c0564e1a097176f14e7115c17104cb26360d789269f7e452d9b8ac6a3b8945c07081b33ac01a0dc6b057ac2591f402a243c3b81e429e750442d0a86f0fc112cf2eaaac26d4b8da03e5cace679d3104fae7f63ef0e64e7f4be5cfae64f9e03aebc0e19e5de0f29f8'),
        ssz_tx_bytes=bytes.fromhex('08000000fe0c0000050101000000000000000000000000000000000000000000000000000000000000003615000000000000000000000000000000000000000000000000000000000000000000000000000024b20b00000000003765521db364ee269e9540970fd21e5a3e82569900000000000000000000000000000000000000000000000000000000000000008d000000110600005f53273d00000000000000000000000000000000000000000000000000112cfa39a81d7c00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004e4128acb080000000000000000000000003765521db364ee269e9540970fd21e5a3e825699000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001dac7be33000000000000000000000000000000000000000000000000000000010005bd8200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006a9850e46518231b23e50467c975fa94026be5d5000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000324128acb0800000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f564000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000001ade409ce94c21807e0000000000000000000000000000000000000000000000000000000010005bd8200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f1f85b2c54a2bd284b1cf4141d64fd171bd855390000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000f1f85b2c54a2bd284b1cf4141d64fd171bd8553900000000000000000000000000000000000000000000000034a2e5498f6f66f80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4022c0d9f0000000000000000000000000000000000000000000001ade409ce94c21807e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a9850e46518231b23e50467c975fa94026be5d5000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c000000940000000c010000440100003c020000d40200000c03000084030000dc030000340400000c05000024050000bc050000d4050000ac0600001c86b3cdf2a60ae3a574f7f71d44e2c50bddb87e18000000000000000000000000000000000000000000000000000000000000000000000350f2c0a7453ed72f1987f5c26e34dd531d584edf35a9b2dd71d8cbd0b46cbec2c02aaa39b223fe8d0a0e5c4f27ead9083c756cc218000000c5192a5360898ecb25d40688e79d4568e38430536a3f38f85b3859328d3cedbccc805915145ea1d9dd6fe22fe624a946d6b02968a5cf3e32ab5376b3fcedd207390f6178407c9b8e95802b8659e6df8e34c1e3d4f8d6a49e6132bbcdd937b63a3765521db364ee269e9540970fd21e5a3e825699180000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb481800000010d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c31f21a62c4538bacf2aabeca410f0fe63151869f172e03c0e00357ba26a341eff0000000000000000000000000000000000000000000000000000000000000001faa1053f6d4d1d5c438dc7bcb1d301a860f75f57f936878518deaed1f60940d0390f6178407c9b8e95802b8659e6df8e34c1e3d4f8d6a49e6132bbcdd937b63a441b08c38c1e5e3510dc0c6fdeb4e6a8d60744b906171767ae804339d85b866c6a9850e46518231b23e50467c975fa94026be5d518000000918cfc45073e7a8befeda107cec8f3ce514f4a406e227c253b570e1d6485d52400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000157ab1ec28d129707052df4df418d58a2d46d5f5118000000000000000000000000000000000000000000000000000000000000000000000205a9cbe762b36632b3594da4f082340e0e5343e818000000faa1053f6d4d1d5c438dc7bcb1d301a860f75f57f936878518deaed1f60940d0c5192a5360898ecb25d40688e79d4568e38430536a3f38f85b3859328d3cedbc0000000000000000000000000000000000000000000000000000000000000002613c773c7a1d85d2f1dcc051b0573d33470762eb180000000563a8a19823933e751ef690567f0351d13ee18500841743a77290b3deeac37d41feecc8dc55520132a464384eb4cad04fca8408899b069cf80a59042ac84c7ac757acba3c0506218b3022266a9dc7f3612d85f518000000ad77bf801726b2c83e9e3fa10f319bf2df99397a561126e8c3df0f7596519f75f0afdce5671e49e66c5829c89ac80a06875a30b8a123df04dc6cc02b9c7c845cf1f85b2c54a2bd284b1cf4141d64fd171bd85539180000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000001800000088e6a0c2ddd26feeb64f039a2c41296fcb3f564018000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001a6172f64e80168333d3bc97ef096a7cb251d24be47156dff7a40f6163a6ab42ba2327a938febf5fec13bacfb16ae10ecbc4cbdcf180000004d8dbd193d89b7b506be5dc9db75b91da00d6a1d180000000000000000000000000000000000000000000000000000000000000000000004b79e191a25a1c10448c48948add5400e67bdba9b68cb8e4ab5ccc4025afe7bf6000000000000000000000000000000000000000000000000000000000000000bd8f0dca3c14b74279ad90a75338db7cccdd5b2448369aeb32a94693a1c4cde0d00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000002545973f28950f50fc6c7f52aab4ad214a27c05641800000097176f14e7115c17104cb26360d789269f7e452d9b8ac6a3b8945c07081b33acffdc6b057ac2591f402a243c3b81e429e750442d0a86f0fc112cf2eaaac26d4b8d3e5cace679d3104fae7f63ef0e64e7f4be5cfae64f9e03aebc0e19e5de0f29f801'),
        sig_hash=Hash32(bytes.fromhex('f4dbd7e72dc303d0790b23d56e88034bbf368e7f56a603ba345ccec74f454365')),
        rlp_tx_hash=Hash32(bytes.fromhex('8135b5403ea5528341d661cdadd8eb67983909fc1644b0a133de708b13e10937')),
        ssz_tx_root=Hash32(bytes.fromhex('94e075ebf7009a815e28127a46906fd2f4b8e6e051f7ea3359c55b9c7c2d0c3e')),
        from_=ExecutionAddress(bytes.fromhex('1fd34033240c95aabf73e186a94b9576c6dab81b')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x07,
        rlp_tx_bytes=bytes.fromhex('02f9034c01830f9b358085064a2d5a958302690c946b75d8af000000e20b7a7ddf000ba900b4009a808403e168d79b2b2f1a397217ae1de4a6e543858b0191c9213aadbcc4ed256de6ecf902c0f85994c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2f842a012231cd4c753cb5530a43a74c45106c24765e6f81dc8927d4f4be7e53315d5a8a0f3bba710d3566d618899e2756f47b6b6ab971f4e7a9b49c8676839ce70a3b615f8dd94397217ae1de4a6e543858b0191c9213aadbcc4edf8c6a0000000000000000000000000000000000000000000000000000000000000000ca00000000000000000000000000000000000000000000000000000000000000008a00000000000000000000000000000000000000000000000000000000000000006a00000000000000000000000000000000000000000000000000000000000000007a00000000000000000000000000000000000000000000000000000000000000009a0000000000000000000000000000000000000000000000000000000000000000af90183944ecfc56672c7630b84dac9c1f7407579715de155f9016ba0000000000000000000000000000000000000000000000000000000000000000fa038ed69781a961bb9622064044b9913b1581bddd02ed6468e0e8c3899ae4ff6cea029cb8bd4e192d16f51155329ce8b0f5eb88a1d9e4d3b93ce07efbac9e1c4d175a0a34640eb1c607d836ceb4af07c59befcec4cdb4943351c3a245f8712063aa3b6a0000000000000000000000000000000000000000000000000000000000000000aa00000000000000000000000000000000000000000000000000000000000000008a00e0b1ffc883156bcc50271d13adbf2142a3da019b453b028078482a0967df23ba0dc59cdc7b4ec63ea402af3d39d169ec1338c1dd00754c63deca3620ef11ce970a04eb8e6d369a44c627e68958caefca5b050389afd4410af55103da22160f32e6fa0e9c8ce3daf53241f9a1be37866116a52a57048d3c7f27faf9b4e8c6e2e50cf81a0489f94fa9c8ead25fac83530419e4f3ae96ec772b8179124ec3bf465ad8ddb2e01a0bcd30031cd0ee1132ec0fd4debd5157269adf0e478e4c4733d846b09f8891dcda02afb6af719e9b548c7d543e7698c5a9c15f97d7f126277d7178ff33670d84e08'),
        ssz_tx_bytes=bytes.fromhex('080000008503000007020100000000000000000000000000000000000000000000000000000000000000359b0f0000000000955a2d4a060000000000000000000000000000000000000000000000000000000c690200000000006b75d8af000000e20b7a7ddf000ba900b4009a80d768e10300000000000000000000000000000000000000000000000000000000ad000000c800000000000000000000000000000000000000000000000000000000000000000000002b2f1a397217ae1de4a6e543858b0191c9213aadbcc4ed256de6ec0c000000640000003c010000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21800000012231cd4c753cb5530a43a74c45106c24765e6f81dc8927d4f4be7e53315d5a8f3bba710d3566d618899e2756f47b6b6ab971f4e7a9b49c8676839ce70a3b615397217ae1de4a6e543858b0191c9213aadbcc4ed18000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a4ecfc56672c7630b84dac9c1f7407579715de15518000000000000000000000000000000000000000000000000000000000000000000000f38ed69781a961bb9622064044b9913b1581bddd02ed6468e0e8c3899ae4ff6ce29cb8bd4e192d16f51155329ce8b0f5eb88a1d9e4d3b93ce07efbac9e1c4d175a34640eb1c607d836ceb4af07c59befcec4cdb4943351c3a245f8712063aa3b6000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000080e0b1ffc883156bcc50271d13adbf2142a3da019b453b028078482a0967df23bdc59cdc7b4ec63ea402af3d39d169ec1338c1dd00754c63deca3620ef11ce9704eb8e6d369a44c627e68958caefca5b050389afd4410af55103da22160f32e6fe9c8ce3daf53241f9a1be37866116a52a57048d3c7f27faf9b4e8c6e2e50cf81489f94fa9c8ead25fac83530419e4f3ae96ec772b8179124ec3bf465ad8ddb2effbcd30031cd0ee1132ec0fd4debd5157269adf0e478e4c4733d846b09f8891dcd2afb6af719e9b548c7d543e7698c5a9c15f97d7f126277d7178ff33670d84e0801'),
        sig_hash=Hash32(bytes.fromhex('b7dfe5ff249ba41f9043c9eabd0003d5b045c252147372391d6f401b64f04dd2')),
        rlp_tx_hash=Hash32(bytes.fromhex('ba363483b992ef59342094ab98b8523ed6c055b5788e6726140d2badf27bf6d6')),
        ssz_tx_root=Hash32(bytes.fromhex('36fb0b66b21e07c3452c0a39b6f525245ee8a02f83463f8061eeb8621eab97e1')),
        from_=ExecutionAddress(bytes.fromhex('ae2fc483527b8ef99eb5d9b44875f005ba1fae13')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x08,
        rlp_tx_bytes=bytes.fromhex('02f911d401038419fa53ad850c87eaa4da830efb7a8080b9117a608060405260405162000eda38038062000eda83398101604081905262000026916200049d565b828162000036828260006200004d565b50620000449050826200008a565b505050620005d0565b6200005883620000e5565b600082511180620000665750805b1562000085576200008383836200012760201b620001791760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000b562000156565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000e2816200018f565b50565b620000f08162000244565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200014f838360405180606001604052806027815260200162000eb360279139620002f8565b9392505050565b60006200018060008051602062000e9383398151915260001b6200037760201b620001a51760201c565b546001600160a01b0316919050565b6001600160a01b038116620001fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200022360008051602062000e9383398151915260001b6200037760201b620001a51760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6200025a816200037a60201b620001a81760201c565b620002be5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001f1565b80620002237f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200037760201b620001a51760201c565b6060600080856001600160a01b0316856040516200031791906200057d565b600060405180830381855af49150503d806000811462000354576040519150601f19603f3d011682016040523d82523d6000602084013e62000359565b606091505b5090925090506200036d8683838762000389565b9695505050505050565b90565b6001600160a01b03163b151590565b60608315620003fa578251620003f2576001600160a01b0385163b620003f25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001f1565b508162000406565b6200040683836200040e565b949350505050565b8151156200041f5781518083602001fd5b8060405162461bcd60e51b8152600401620001f191906200059b565b80516001600160a01b03811681146200045357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200048b57818101518382015260200162000471565b83811115620000835750506000910152565b600080600060608486031215620004b357600080fd5b620004be846200043b565b9250620004ce602085016200043b565b60408501519092506001600160401b0380821115620004ec57600080fd5b818601915086601f8301126200050157600080fd5b81518181111562000516576200051662000458565b604051601f8201601f19908116603f0116810190838211818310171562000541576200054162000458565b816040528281528960208487010111156200055b57600080fd5b6200056e8360208301602088016200046e565b80955050505050509250925092565b60008251620005918184602087016200046e565b9190910192915050565b6020815260008251806020840152620005bc8160408501602087016200046e565b601f01601f19169190910160400192915050565b6108b380620005e06000396000f3fe60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000007e22fcb742572515d1c3fef972ec066c995820ef000000000000000000000000d89f6892a2b58d50e0e8f51a961b12a25ce3f7570000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000020457405d050000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000064c7eb930000000000000000000000000000000000000000000000000000000064d2bde300000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000004580900be782a567ad407cc8fcde24dbda2a1aae000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000165a0bc00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000009795118749000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000023a8f4b6a00000000000000000000000000000000000000000000000000000000c080a06fd00841d705c002a846de1b56d0c36941cd2897a7bb19419d427a252bc4fff4a05be5ed4725f8b6047b5309da5f47d1e98fa2c79e5c0841595291fae7167de108'),
        ssz_tx_bytes=bytes.fromhex('080000001c120000080201000000000000000000000000000000000000000000000000000000000000000300000000000000daa4ea870c0000000000000000000000000000000000000000000000000000007afb0e000000000000000000000000000000000000000000000000000000000000000000000000009900000013120000ad53fa1900000000000000000000000000000000000000000000000000000000608060405260405162000eda38038062000eda83398101604081905262000026916200049d565b828162000036828260006200004d565b50620000449050826200008a565b505050620005d0565b6200005883620000e5565b600082511180620000665750805b1562000085576200008383836200012760201b620001791760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f620000b562000156565b604080516001600160a01b03928316815291841660208301520160405180910390a1620000e2816200018f565b50565b620000f08162000244565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200014f838360405180606001604052806027815260200162000eb360279139620002f8565b9392505050565b60006200018060008051602062000e9383398151915260001b6200037760201b620001a51760201c565b546001600160a01b0316919050565b6001600160a01b038116620001fa5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200022360008051602062000e9383398151915260001b6200037760201b620001a51760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6200025a816200037a60201b620001a81760201c565b620002be5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401620001f1565b80620002237f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b6200037760201b620001a51760201c565b6060600080856001600160a01b0316856040516200031791906200057d565b600060405180830381855af49150503d806000811462000354576040519150601f19603f3d011682016040523d82523d6000602084013e62000359565b606091505b5090925090506200036d8683838762000389565b9695505050505050565b90565b6001600160a01b03163b151590565b60608315620003fa578251620003f2576001600160a01b0385163b620003f25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620001f1565b508162000406565b6200040683836200040e565b949350505050565b8151156200041f5781518083602001fd5b8060405162461bcd60e51b8152600401620001f191906200059b565b80516001600160a01b03811681146200045357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200048b57818101518382015260200162000471565b83811115620000835750506000910152565b600080600060608486031215620004b357600080fd5b620004be846200043b565b9250620004ce602085016200043b565b60408501519092506001600160401b0380821115620004ec57600080fd5b818601915086601f8301126200050157600080fd5b81518181111562000516576200051662000458565b604051601f8201601f19908116603f0116810190838211818310171562000541576200054162000458565b816040528281528960208487010111156200055b57600080fd5b6200056e8360208301602088016200046e565b80955050505050509250925092565b60008251620005918184602087016200046e565b9190910192915050565b6020815260008251806020840152620005bc8160408501602087016200046e565b601f01601f19169190910160400192915050565b6108b380620005e06000396000f3fe60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005e6101ea565b9150610167565b6001600160e01b0319811663278f794360e11b14156100865761005e610241565b6001600160e01b031981166308f2839760e41b14156100a75761005e610287565b6001600160e01b031981166303e1469160e61b14156100c85761005e6102b8565b6001600160e01b03198116635c60da1b60e01b14156100e95761005e6102f8565b60405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b815160208301f35b61017761030c565b565b606061019e83836040518060600160405280602781526020016108576027913961031c565b9392505050565b90565b6001600160a01b03163b151590565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b60606101f4610394565b600061020336600481846106a2565b81019061021091906106e8565b905061022d8160405180602001604052806000815250600061039f565b505060408051602081019091526000815290565b606060008061025336600481846106a2565b8101906102609190610719565b915091506102708282600161039f565b604051806020016040528060008152509250505090565b6060610291610394565b60006102a036600481846106a2565b8101906102ad91906106e8565b905061022d816103cb565b60606102c2610394565b60006102cc6101b7565b604080516001600160a01b03831660208201529192500160405160208183030381529060405291505090565b6060610302610394565b60006102cc610422565b610177610317610422565b610431565b6060600080856001600160a01b0316856040516103399190610807565b600060405180830381855af49150503d8060008114610374576040519150601f19603f3d011682016040523d82523d6000602084013e610379565b606091505b509150915061038a86838387610455565b9695505050505050565b341561017757600080fd5b6103a8836104d3565b6000825111806103b55750805b156103c6576103c48383610179565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103f46101b7565b604080516001600160a01b03928316815291841660208301520160405180910390a161041f81610513565b50565b600061042c6105bc565b905090565b3660008037600080366000845af43d6000803e808015610450573d6000f35b3d6000fd5b606083156104c15782516104ba576001600160a01b0385163b6104ba5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161015e565b50816104cb565b6104cb83836105e4565b949350505050565b6104dc8161060e565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105785760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b606482015260840161015e565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6101db565b8151156105f45781518083602001fd5b8060405162461bcd60e51b815260040161015e9190610823565b6001600160a01b0381163b61067b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161015e565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61059b565b600080858511156106b257600080fd5b838611156106bf57600080fd5b5050820193919092039150565b80356001600160a01b03811681146106e357600080fd5b919050565b6000602082840312156106fa57600080fd5b61019e826106cc565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561072c57600080fd5b610735836106cc565b9150602083013567ffffffffffffffff8082111561075257600080fd5b818501915085601f83011261076657600080fd5b81358181111561077857610778610703565b604051601f8201601f19908116603f011681019083821181831017156107a0576107a0610703565b816040528281528860208487010111156107b957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b838110156107f65781810151838201526020016107de565b838111156103c45750506000910152565b600082516108198184602087016107db565b9190910192915050565b60208152600082518060208401526108428160408501602087016107db565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122012bb4f564f73959a03513dc74fc3c6e40e8386e6f02c16b78d6db00ce0aa16af64736f6c63430008090033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000007e22fcb742572515d1c3fef972ec066c995820ef000000000000000000000000d89f6892a2b58d50e0e8f51a961b12a25ce3f7570000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000020457405d050000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000064c7eb930000000000000000000000000000000000000000000000000000000064d2bde300000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000004580900be782a567ad407cc8fcde24dbda2a1aae000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000165a0bc00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000009795118749000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000023a8f4b6a00000000000000000000000000000000000000000000000000000000ff6fd00841d705c002a846de1b56d0c36941cd2897a7bb19419d427a252bc4fff45be5ed4725f8b6047b5309da5f47d1e98fa2c79e5c0841595291fae7167de10800'),
        sig_hash=Hash32(bytes.fromhex('ef9132fa5b840358cf384376c697bf04ea540010d592ce683e9fde205bedf6fe')),
        rlp_tx_hash=Hash32(bytes.fromhex('a3b805acacb25da412a44bd9612a73464292fc684a400ab54f0a9626f7d9c3f2')),
        ssz_tx_root=Hash32(bytes.fromhex('ead34aea6fc557e3c4a274e01725f79c5365a49de032214bbed6d7ea5558b312')),
        from_=ExecutionAddress(bytes.fromhex('979db18107552faa36a52480a1dbb65ed3f51d70')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x09,
        rlp_tx_bytes=bytes.fromhex('03f8930180843b9aca008601d1e4e4ea008252089400000000000000000000000000000000000000008080c0843b9aca00e1a00175f564b393e44640ecffddce4010a42c1c966413987d8a59a253ef64a0c5cf01a04169d4bf9df18182d86715d4ec031c20aded1a4a2613f57e0c0169e16cf763c2a006fc81d18602b8a1e065193488a7c943dfd780adb7b72dfc332de7d68605986e'),
        ssz_tx_bytes=bytes.fromhex('08000000fa00000009030100000000000000000000000000000000000000000000000000000000000000000000000000000000eae4e4d101000000000000000000000000000000000000000000000000000000ca9a3b00000000000000000000000000000000000000000000000000000000085200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d1000000d100000000ca9a3b00000000000000000000000000000000000000000000000000000000d10000000175f564b393e44640ecffddce4010a42c1c966413987d8a59a253ef64a0c5cfff4169d4bf9df18182d86715d4ec031c20aded1a4a2613f57e0c0169e16cf763c206fc81d18602b8a1e065193488a7c943dfd780adb7b72dfc332de7d68605986e01'),
        sig_hash=Hash32(bytes.fromhex('a872811828b0780fa9418b67ad12a6328dd88d4d378204955dbb6be0306490e1')),
        rlp_tx_hash=Hash32(bytes.fromhex('9c1fbda4f649ac806ab0faefbe94e1a60282eb374ead6aa01bac042f52b28a8c')),
        ssz_tx_root=Hash32(bytes.fromhex('3e232514a636128795bef82c71118f7cf1fa7efd2ab50aae9f30bd1c120a9eab')),
        from_=ExecutionAddress(bytes.fromhex('40c35d4faf69234986cb599890c2d2ef546074a9')),
        authorities=[],
    ),
    Test(
        tx_payload_selector=0x0a,
        rlp_tx_bytes=bytes.fromhex('04f9017a010203040594000102030405060708091011121314151617181906824269f85bf859942021222324252627282930313233343536373839f842a0000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1fa0202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3ff8baf85a809430313233343536373839404142434445464748498001a0a4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d454a028aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f6f85c0194505152535455565758596061626364656667686982030901a0a4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d454a028aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f601a0a4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d454a028aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f6'),
        ssz_tx_bytes=bytes.fromhex('08000000100200000a04010000000000000000000000000000000000000000000000000000000000000002000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000010203040506070809101112131415161718190600000000000000000000000000000000000000000000000000000000000000b1000000b300000003000000000000000000000000000000000000000000000000000000000000000f010000426904000000202122232425262728293031323334353637383918000000000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f08000000700000000800000026000000010530313233343536373839404142434445464748490000000000000000ffa4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d45428aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f60108000000460000000205010000000000000000000000000000000000000000000000000000000000000050515253545556575859606162636465666768690903000000000000ffa4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d45428aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f601ffa4be86c16c6d3a2b907660b24187d0b30b69f6db3e6e8e7a7bb1183a4706d45428aba84cdee6059dde41620422959d01da4f6cfff21a9b97036db018f1d815f601'),
        sig_hash=Hash32(bytes.fromhex('b1bf9454901a644d9a636f65f5cdcc04dc19901377c72c9fffec3f97c0709762')),
        rlp_tx_hash=Hash32(bytes.fromhex('aef87a34a0efb40e90614a96fa0dfa74c596dfb772ce8c73d624121f17aaa610')),
        ssz_tx_root=Hash32(bytes.fromhex('42b1c07a3bb53149f9f9df24af4da4070c4b17a02e9e2ecf5bf91580f6e60d7a')),
        from_=ExecutionAddress(bytes.fromhex('55c158d0fa4619db7e655a78e6627a752a847f12')),
        authorities=[
            ExecutionAddress(bytes.fromhex('4fd357b597c2d9c930a24645958f8cbc43a11d2e')),
            ExecutionAddress(bytes.fromhex('fc8ceb2413f8f3808eab57499da4a8b5179f6820')),
        ],
    ),
]

for test in tests:
    tx = upgrade_rlp_transaction_to_ssz(test.rlp_tx_bytes)
    validate_transaction(tx)

    assert tx.payload.selector() == test.tx_payload_selector
    assert tx.encode_bytes() == test.ssz_tx_bytes

    assert compute_sig_hash(tx) == test.sig_hash
    assert compute_tx_hash(tx) == test.rlp_tx_hash
    assert tx.hash_tree_root() == test.ssz_tx_root

    assert recover_execution_signer(tx.signature, compute_sig_hash(tx)) == test.from_
    assert [
        recover_execution_signer(auth.signature, compute_auth_hash(auth))
        for auth in getattr(tx.payload.data(), 'authorization_list', [])
    ] == test.authorities
